#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<fcntl.h>
#include<unistd.h>

int main(int argc,const char* argv[]){
    // if(argc != 2){
    //     return -1;
    // }
    int fd = open("./test.txt",O_RDWR);
    if(fd == -1){
        perror("open err");
        return -1;
    }
    lseek(fd,10,SEEK_SET);
    write(fd,"s",1);
    lseek(fd,20,SEEK_CUR);
    write(fd,"hello",5);
    off_t off= lseek(fd,0,SEEK_END);
    printf("文件长度%ld\n",off);



    close(fd);



    return 0;
}